package tt.dz.appserver.entity.vo.user;

import java.io.Serializable;

import org.springframework.util.StringUtils;

import com.alibaba.fastjson.JSONObject;

import tt.dz.appserver.util.Constants;

public class UserBaseVo implements Serializable{

	private static final long serialVersionUID = 1L;
	private String nickName;
	private String sex;
	private String userId;
	private String signature;
	UserHeadImageVo headImage;
	private String phone;
	
	
	public String getNickName() {
		return nickName;
	}
	public void setNickName(String nickName) {
		this.nickName = nickName;
	}
	public String getSex() {
		return sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	public String getSignature() {
		return signature;
	}
	public void setSignature(String signature) {
		this.signature = signature;
	}
	public UserHeadImageVo getHeadImage() {
		return headImage;
	}	
	
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	//设置头像
	public void setHeadImage(String headImagePath) {

		if(headImagePath!=null && !StringUtils.isEmpty(headImagePath)){
			UserHeadImageVo userHeadImageVo = JSONObject.parseObject(headImagePath, UserHeadImageVo.class);
			this.headImage = userHeadImageVo;
			userHeadImageVo.setBigImage(Constants.qiniuBaseUrl+userHeadImageVo.getBigImage());
			userHeadImageVo.setSmallImage(Constants.qiniuBaseUrl+userHeadImageVo.getSmallImage());
			userHeadImageVo.setMiddleImage(Constants.qiniuBaseUrl+userHeadImageVo.getMiddleImage());
		}
	}
}
